<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('外包未返回统计列表')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                统计日期：
                                <input type="text" class="input-sm" placeholder="请选择日期" id="timeFlag" name="timeFlag" required/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="query()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="outsource:partoutsourcenoreturnsta:export">
                    <i class="fa fa-download"></i> 导出
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
     <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('outsource:partoutsourcenoreturnsta:edit')}]];
        var removeFlag = [[${@permission.hasPermi('outsource:partoutsourcenoreturnsta:remove')}]];
        var os_appoint_site = [[${@dict.getType('os_appoint_site')}]];
        var prefix = ctx + "outsource/partoutsourcenoreturnsta";
        var tableinit = true;

        var columns = [
            {
                field: 'id',
                title: 'UUID',
                visible: false
            },
            {
                field: 'timeFlag',
                title: '日期时间标识'
            },
            {
                field: 'seq',
                title: '序号'
            },
            {
                field: 'partType',
                title: '产品类型'
            },
            {
                field: 'outsourceStep',
                title: '外包工步'
            },
            {
                field: 'appointSite',
                title: '外包场所',
                formatter: function(value, row, index) {
                    return $.table.selectDictLabel(os_appoint_site, value);
                }
            },
            {
                field: 'customerName',
                title: '客户'
            },
            {
                field: 'less7NoReturn',
                title: '&lt;=7天未回片数'
            },
            {
                field: 'less14NoReturn',
                title: '&gt;7天&lt;=14天未回片数'
            },
            {
                field: 'more14NoReturn',
                title: '&gt;14天未回片数'
            },
            {
                field: 'total',
                title: '总计片数'
            }
        ];

        var options = {
            url: prefix + "/list",
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            modalName: "外包未返回统计",
            columns: columns
        };

        $(function() {
            layui.use('laydate', function(){
                var laydate = layui.laydate;
                laydate.render({
                    elem: '#timeFlag',
                    type: 'date',
                    value: new Date()
                });
            });

        });

        function query() {
            if (tableinit) {
                $.table.init(options);
                tableinit = false;
            } else {
                $.table.search();
            }
        }
    </script>
</body>
</html>